#include <stdio.h>
#include <stdlib.h>

//#define FILESIZE 1000
#define LINESIZE 128
void gen_str_random(char *s, const int len);

int main(int argc, char **argv)
{
        
    FILE *pFile;
    int i =0;
    int fz_max = atoi(argv[2]);
    int lz_max = atoi(argv[3]);
    
    char str[lz_max];
    fprintf(stderr, "TEST FILE SIZE MAZ: - %d\n", fz_max);
    fprintf(stderr, "TEST LINE SIZE MAZ: - %d\n", lz_max);
    
    pFile = fopen(argv[1], "w");
    if(pFile !=NULL)
    {
        //loop for random string
        for(i = 0; i< fz_max; i++)
        {
            gen_str_random(str, lz_max);
            fprintf(pFile, "Title: %s\n", str); 
        }
    }
    fclose(pFile);
    //close file
    return 0;
}

void gen_str_random(char *s, const int len)
{
    int i = 0;
    static const char alphanum[]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    for(i = 0; i< len; i++)
    {
        s[i]=alphanum[rand() % (sizeof(alphanum)-1)];
    }
    s[len]=0;
}
